package allwe.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

//@ControllerAdvice
public class ExceptionHandler1 {

    @ExceptionHandler(value = {Exception.class})
    public ModelAndView handlerException(){
        System.out.println("出了异常默认走这里 XX==========================");


        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/error1.jsp");
        return modelAndView;
    }
}
